package com.example.hotsearchplatform.controller;

import com.example.hotsearchplatform.dto.HotSearchForward5DTO;
import com.example.hotsearchplatform.pojo.entity.Information;
import com.example.hotsearchplatform.result.Result;
import com.example.hotsearchplatform.service.InformationService;
import com.example.hotsearchplatform.vo.InfoLookVO;
import com.example.hotsearchplatform.vo.searchCountVO;
import io.swagger.v3.oas.annotations.Operation;
import com.example.hotsearchplatform.service.impl.InformationServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/info")
@Tag(name="搜索信息")
public class InformationController {

    @Autowired
    private InformationService informationService;


    @Operation(summary = "最新浏览量排名top10")
    @GetMapping("/lookTop10")
    public Result<List<InfoLookVO>> getLookTop10() {
        List<InfoLookVO> list = informationService.lookTop10();

        return Result.ok(list);
    }

    @Operation(summary = "柱状图展示信息")
    @GetMapping("/column")
    public Result getColumnChart() {
        return Result.ok(informationService.getColumnChart(),"success");
    }


}
